package com.kycq.viewpager;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.kycq.viewpager.databinding.ActivityMainBinding;
import com.kycq.viewpager.fragment.normal.NormalPagerActivity;
import com.kycq.viewpager.fragment.state.StatePagerActivity;
import com.kycq.viewpager.simple.SimplePagerActivity;

public class MainActivity extends AppCompatActivity {
	private ActivityMainBinding mDataBinding;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mDataBinding = DataBindingUtil.setContentView(this, R.layout.activity_main);
		mDataBinding.tvSimple.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, SimplePagerActivity.class);
				startActivity(intent);
			}
		});
		mDataBinding.tvNormal.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, NormalPagerActivity.class);
				startActivity(intent);
			}
		});
		mDataBinding.tvState.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, StatePagerActivity.class);
				startActivity(intent);
			}
		});
	}
}
